package org.jeecg.enums.car;

/**
 * 审核状态
 */
public enum CheckStatusEnum {

    CHECK_STATUS_NO(-1, "未通过"),
    CHECK_STATUS_YES(1, "通过"),
    CHECK_STATUS_ING(0, "待审核"),
    ;


    private Integer code;
    private String desc;

    CheckStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


    public static String getDesc(Integer value) {
        if (value == null) return "";
        CheckStatusEnum[] enums = values();
        for (CheckStatusEnum typeEnum : enums) {
            if (value.intValue() == typeEnum.getCode().intValue()) {
                return typeEnum.desc;
            }
        }
        return "";
    }

    public static Integer getValue(String desc) {
        CheckStatusEnum[] enums = values();
        for (CheckStatusEnum typeEnum : enums) {
            if (typeEnum.getDesc().equals(desc)) {
                return typeEnum.code;
            }
        }
        return null;
    }

}
